#!/usr/bin/env python
# coding:utf-8

__author__ = "SQL-RICE Proyect"

__copyright__ = "Copyright (C) 2012 Daniel Contreras, Jan Gallardo, Alejadro Peña, Jesus Rojas, Gustavo Rubio,"

__license__ = "GPLv3"

__version__ = "0.1"
import unittest
from sql_rice.dbinspect import sqlite


class TestInspector(unittest.TestCase):

    def setUp(self):
        import sqlite3
        conn = sqlite3.connect(':memory:')
        cursor = conn.cursor()
        cursor.execute('CREATE TABLE empleados(rut text, nombre text,' +
                       ' email text)')
        cursor.execute('INSERT INTO empleados VALUES(:rut, :nombre, :email)',
            {'rut': '1111', 'nombre': 'Koke', 'email': 'algo@don.com'})

        conn.commit()
        self.connection = conn


    def test_get_data_dict(self):
        dd = sqlite.inspect(self.connection)
        self.assertTrue('empleados' in dd)
